<!doctype html>
<html lang="en">
 <head>
  <meta charset="UTF-8">
  <meta name="Generator" content="EditPlus®">
  <meta name="Author" content="">
  <meta name="Keywords" content="">
  <meta name="Description" content="">
  <title>Document</title>
 </head>
 <body>
    <button id="btn_1">警告框</button>
	<button id="btn_2">确认框</button>
	<button id="btn_3">输入框</button>
	<p id="info"></p>
 </body>
  <script>
     var $ = function(obj){
	     return document.getElementById(obj);
	 }
	 window.onload = function(){
	    //警告框
		$("btn_1").onclick = function(){
		   window.alert("你好，我是警告框");
		}
		//确认框
		var text = $("info");
		$("btn_2").onclick = function(){
		   var content = window.confirm("请按下按钮");
		    text.innerText = content;
		}
		//输入框
		$("btn_3").onclick = function(){
		   var s = window.prompt("请输入内容");
		   text.innerText = s;
		}
	 }
  </script>
</html>
